/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gtree;

/**
 *
 * @author Gustavo
 */
public class GTree {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            Tree tree = new Tree("A");
            Position a = tree.root();
            Position b = tree.addChild(a, "B");
            Position c = tree.addChild(tree.parent(b), "C");
            Position d = tree.addChild(b, "D");
            Position f = tree.addChild(d, "F");
            Position g = tree.addChild(f, "G");

            tree.addChild(d, "FD1");
            tree.addChild(d, "FD2");
            tree.addChild(c, "FC1");
            tree.addChild(c, "FC2");
            tree.addChild(d, "FD3");
            tree.addChild(d, "FD4");
            tree.addChild(d, "FD5");
            tree.addChild(c, "FC3");
            tree.addChild(c, "FC4");
            tree.addChild(a, "FA1");
            tree.addChild(a, "FA2");
            tree.addChild(a, "FA3");
            Position fg = tree.addChild(g, "FG");
            tree.addChild(f, "FF");

            /*
             * System.out.println("a is root? " + tree.isRoot(a));
             * System.out.println("c is ext.? " + tree.isExternal(c));
             * System.out.println("d is int.? " + tree.isInternal(d));
             * System.out.println("tree size=" + tree.size());
             *
             * System.out.println("children of a: " + tree.children(a));
             * System.out.println("tree elements: " + tree.elements());
             * ArrayList<Position> node_list = tree.positions();
             * System.out.println("# of nodes=" + node_list.size());
             *
             * tree.swapElements(a, b); System.out.println("a now contains " +
             * a); System.out.println("b now contains " + b);
             *
             * String s = tree.replaceElement(c, "CC"); System.out.println("c
             * now contains " + c + " but previoulsy had " + s);
             *
             * System.out.println("b has " + tree.children(b).size() + " child
             * nodes"); tree.removeExternal(fg); System.out.println("b now has "
             * + tree.children(b).size() + " child nodes");
             */

            DrawTree drawtree = new DrawTree(tree);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
